﻿namespace EFS.RC.Wallboard.Controls.Common
{
	/// <summary>
	/// Interaction logic for ImageCenterTextRectangle.xaml
	/// </summary>
	public partial class ImageLeftTextRectangle : System.Windows.Controls.UserControl
	{
		public ImageLeftTextRectangle()
		{
			InitializeComponent();
		}

		/// Property Text: Get, Set
		public System.String Text
		{
			get
			{
				return textBlock.Text;
			}
			set
			{
				textBlock.Text = value;
			}
		}

		/// Property Image: Get, Set
		public System.Windows.Media.ImageSource Image
		{
			get
			{
				return image.Source;
			}
			set
			{
				image.Source = value;
			}
		}

		/// Property InitialWidth: Set
		public System.Double InitialWidth
		{
			set
			{
				// compute new
				System.Double textInitialWidth = value - 30 - 10;

				// set
				gridMain.ColumnDefinitions[2].Width = new System.Windows.GridLength(textInitialWidth, System.Windows.GridUnitType.Star);
				textBlock.MinWidth = textInitialWidth;
			}
		}
	}

}